home *** CD-ROM | disk | FTP | other *** search
- /* %filename% -- modeless dialog */
- /* Created %date% %time% by AppMaker */
-
- %If MPW%
- #include <Types.h>
- #include <Quickdraw.h>
- #include <Controls.h>
- #include <Dialogs.h>
- #include <Events.h>
- #include <Lists.h>
- #include <Menus.h>
- #include <TextEdit.h>
-
- %end if%
- #include "ResourceDefs.h"
- #include "DialogAids.h"
-
- #include "%unitname%.h"
-
- DialogPtr %dlogname%Dialog;
-
- #define nil 0L
-
- %ConstItems%
- %If MPW%
-
- #pragma segment %unitname%
- %end if%
-
- %ItemProcs%
- /*----------*/
- void Init%dlogname% ()
- {
- DialogPtr theDialog;
- Handle %dlogname%Data;
- register %dlogname%Ptr info;
-
- %dlogname%Dialog = GetNewDialog (%dlogname%ID, nil, (WindowPtr) -1L);
- theDialog = %dlogname%Dialog;
- SetPort (theDialog);
- %dlogname%Data = NewHandle (sizeof (%dlogname%Rec));
- SetWRefCon (theDialog, (long) %dlogname%Data);
- HLock (%dlogname%Data);
- info = (%dlogname%Ptr) *%dlogname%Data;
- %InitFields%
- %SetItems%
- %EnableItems%
- HUnlock (%dlogname%Data);
- } /*Init%dlogname%*/
-
- /*----------*/
- void Do%dlogname% ()
- {
- if (%dlogname%Dialog != nil) {
- SelectWindow (%dlogname%Dialog);
- ShowWindow (%dlogname%Dialog);
- } /*if*/
- } /*Do%dlogname%*/
-
- /*----------*/
- void Close%dlogname% ()
- {
- HideWindow (%dlogname%Dialog);
- } /*Close%dlogname%*/
-
- /*----------*/
- Boolean Filter%dlogname% (whichDialog, event, itemHit)
- DialogPtr whichDialog;
- EventRecord *event;
- short *itemHit;
- {
- Boolean filtered;
-
- filtered = false;
- %FilterItems%
- if (!filtered) {
- filtered = StandardFilter (whichDialog, event, itemHit);
- }
- return (filtered);
- } /*Filter%dlogname%*/
-
- /*----------*/
- void Do%dlogname%Item (itemNr)
- short itemNr;
- {
- DialogPtr theDialog;
- Handle %dlogname%Data;
- register %dlogname%Ptr info;
-
- theDialog = %dlogname%Dialog;
- SetPort (theDialog);
- %dlogname%Data = (Handle) GetWRefCon (theDialog);
- HLock (%dlogname%Data);
- info = (%dlogname%Ptr) *%dlogname%Data;
- switch (itemNr) {
- %HandleItems%
- } /*switch*/
- %EnableItems%
- HUnlock (%dlogname%Data);
- } /*Do%dlogname%Item*/
-